#ifndef OPENGL_WIDGET_LIGHT_H_
#define OPENGL_WIDGET_LIGHT_H_

#include <QOpenGLWidget>
#include <QOpenGLFunctions_3_3_Core>
#include<QKeyEvent>
#include<QVector3D>
#include"OpenGLShapeSphere.h"
#include"OpenGLShapeCube.h"
// Opengl 光照练习测试， 按 上,下，左，右键旋转立方体，查看右侧光源照射到物体的效果。

class OpenGLWidgetLight:public QOpenGLWidget, QOpenGLFunctions_3_3_Core
{
	Q_OBJECT
public:
	OpenGLWidgetLight(QWidget* parent);
	void TestMaxGLBufferData();
	~OpenGLWidgetLight() ;
	QString description = "Opengl 光照练习测试， 按 上,下，左，右键旋转立方体，查看左侧光源照射到物体的效果。";

	void setWireFrame(bool wireFrame);

protected:
	virtual void initializeGL();
	virtual void resizeGL(int w, int h);
	//void drawCube(QVector3D center, double length, double width, double height);
	void setLight0();
	void setLight1();
	void setLight2();
	void setMoveLight();
	void setSunMatrial();
	void drawSun();
	//void setMatrial();
	virtual void paintGL();
	virtual void keyPressEvent(QKeyEvent *event) override;
	virtual void wheelEvent(QWheelEvent * event) override;


private:
	QVector3D m_rotate = {0,0,0};
	double m_scale = 0.5;
	ShapeSphere* sphere;// 球体
	//ShapeSphere* sphere1;// 球体
	ShapeCube* cube;// 矩形

private:


};
#endif